<template>
  <view class="content" v-if="productPic">
    <title :title="title"></title>
    <view class="int-content">
      <view
        class="int-con-pro"
        v-for="(item, index) in productPic"
        :key="index"
      >
        <image class="image" :src="getPicPath(item.picture)" />
        <p class="p">{{ item.title }}</p>
      </view>
    </view>
    <title :title="future"></title>
    <view class="int-content">
      <view
        class="int-con-pro"
        v-for="(item, index) in productPic"
        :key="index"
      >
        <image class="image" :src="getPicPath(item.picture)" />
        <p class="p">{{ item.title }}</p>
      </view>
    </view>
  </view>
</template>

<script>
import title from "../common/Title.vue";
// 引入baseUrl
import { baseUrl } from "@/api/request.js";
export default {
  name: "activement",
  props: {
    productPic: Array,
  },
  components: {
    title,
  },
  data() {
    return {
      title: "取得成果",
      future: "期待未来",
    };
  },
  methods: {
    getPicPath(picture) {
      let path = picture;
      path = path.replace("static", "");
      path = path.replace(/\\/g, "/");
      path = baseUrl + path;
      return path;
    },
  },
};
</script>

<style lang="scss" scoped>
.content {
  width: 730rpx;
  background-color: white;
  margin-top: 30px;
  border-radius: 10px;
  padding-bottom: 20px;
  border-bottom: 2px solid aliceblue;

  .int-content {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: space-around;
    border-radius: 10px;

    .int-con-pro {
      padding: 10px 0;
      width: 300rpx;
      height: 428rpx;

      .image {
        width: 300rpx;
        height: 400rpx;
      }

      .p {
        font-size: 14px;
        color: #595959;
        padding-top: 5px;
        text-align: center;
      }
    }
  }
}
</style>